<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function aa() {
            console.log('head', document.getElementsByClassName('head'))
        }
        this.aa()
    </script>
</head>

<body>
    <div class="head">
    </div>
    <iframe src="./line-simple.html" frameborder="10" name="demo" id="demo" width="80%" height="600">22</iframe>
    <p><a href="http://www.baidu.com" target="demo">5555</a></p>
    <!-- https://www.jianshu.com/p/7ec986aa28a7 -->
    <script>
        var params = {
            a: '2',
            b: '0',
        };
        function pp() {
            this.params.a = '10'
            // this.$set(this.params,'b','20')
            this.params.c = '20'
            // console.log(this.params,this.params.a)
            let iframe = document.getElementById('demo');
            let iwindow = iframe.contentWindow; // 获取iframe的window对象
            let idoc = iframe.contentDocument; // 获取iframe的document对象
            console.log('body', document.getElementsByClassName('head'), window.frames['demo'], iwindow, window, idoc)
        };
        this.pp()
    </script>
</body>

</html>